package com.emm.yixun.common.enums;

import java.io.Serializable;

import org.apache.commons.lang.StringUtils;

public enum ProcessTypeEnums  implements Serializable{
	//公共流程定义
	PROCESS_KEY_1("mktPriceScheme","价格方案审批流程", "0"),
	PROCESS_KEY_2("mktPriceSchemeInvalid","价格方案无效审批流程", "0"),
	PROCESS_KEY_3("cusPayDeposit","认筹审批流程", "0"),
	PROCESS_KEY_4("cusPayDepositRetreat","退筹审批流程", "0"),
	PROCESS_KEY_5("cusSubscribe","认购审批流程", "0"),
	PROCESS_KEY_6("cusCubscribeRetreat","退认购审批流程", "0"),
	PROCESS_KEY_7("cusCubscribeChangeHouse","认购换房审批流程", "0"),
	PROCESS_KEY_8("cusCubscribeAndSignedChangeName","更名审批流程", "0"),
	PROCESS_KEY_9("cusSubDS1","延期签约审批(15天内)流程", "0"),
	PROCESS_KEY_10("cusSubDS2","延期签约审批(15到30天)流程", "0"),
	PROCESS_KEY_11("cusSubDS3","延期签约审批(30天以上)流程", "0"),
	PROCESS_KEY_12("cusSigned","签约审批流程", "0"),
	PROCESS_KEY_13("cusSignedDiscount","签约折扣审批流程", "0"),
	PROCESS_KEY_14("cusSignedChangeHouse","签约换房审批流程", "0"),
	PROCESS_KEY_15("cusSignedCheckOut","签约退房审批流程", "0"),
	//PROCESS_KEY_16("dealReserveArea","面积补差审批流程", "0"),
	PROCESS_KEY_17("cusSubscribeDiscount","认购折扣审批流程", "0"),
	PROCESS_KEY_18("deferredPaymentOne","应收款延期(15天内)流程", "0"),
	PROCESS_KEY_19("deferredPaymentTwo","应收款延期(15到30天)流程", "0"),
	PROCESS_KEY_20("deferredPaymentThree","应收款延期(30天以上)流程", "0"),
	PROCESS_KEY_21("masSubscribeRetreat","退认购审批","0"),
	PROCESS_KEY_22("masSignedCheckOut","签约退房审批","0"),

	//丰策流程定义
	PROCESS_FCKEY_1("FCmktPriceScheme","FCmktPriceScheme", "1"),
	PROCESS_FCKEY_2("FCmktPriceSchemeInvalid","FCmktPriceSchemeInvalid", "1"),
	PROCESS_FCKEY_3("FCcusPayDeposit","FCcusPayDeposit", "1"),
	PROCESS_FCKEY_4("FCcusPayDepositRetreat","FCcusPayDepositRetreat", "1"),
	PROCESS_FCKEY_5("FCcusSubscribe","FCcusSubscribe", "1"),
	PROCESS_FCKEY_6("FCcusCubscribeRetreat","FCcusCubscribeRetreat", "1"),
	PROCESS_FCKEY_7("FCcusCubscribeChangeHouse","FCcusCubscribeChangeHouse", "1"),
	//FC,认购、签约更名,流程名字太长改短了.
	PROCESS_FCKEY_8("FCcusCubscribeAndSignedChangeName","FCcusSubAndSignedChangeName", "1"),
	PROCESS_FCKEY_9("FCcusCubscribeDelaySingedOne","FCcusCubscribeDelaySingedOne", "1"),
	PROCESS_FCKEY_12("FCcusSigned","FCcusSigned", "1"),
	PROCESS_FCKEY_13("FCcusSignedDiscount","FCcusSignedDiscount", "1"),
	PROCESS_FCKEY_14("FCcusSignedChangeHouse","FCcusSignedChangeHouse", "1"),
	PROCESS_FCKEY_15("FCcusSignedCheckOut","FCcusSignedCheckOut", "1"),
	PROCESS_FCKEY_18("FCdeferredPaymentOne","FCdeferredPaymentOne", "1"),
	;
	private final String no;
	private final String des;
	//0:默认流程 1:定制化流程
	private final String init;
	
	/**
	 * 私有构造函数
	 * @param no
	 * @param des
	 */
	ProcessTypeEnums(String no, String des, String init) {
		this.no = no;
		this.des = des;
		this.init = init;
	}

	/**
	 * @return Returns the no.
	 */
	public String getNo() {
		return no;
	}

	/**
	 * @return Returns the des.
	 */
	public String getDes() {
		return des;
	}
	
	/**
	 * @return Returns the init.
	 */
	public String getInit() {
		return init;
	}
	
	public static ProcessTypeEnums getByNo(String no) {
		if(StringUtils.isBlank(no)){
			return null;
		}
		for (ProcessTypeEnums menum : values()) {
			if (menum.getNo().equals(no)) {
				return menum;
			}
		}
		return null;
	}
}
